package reflection;

import java.lang.reflect.Method;

public class ReflectionOpt {
    public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException, NoSuchMethodException {
        Class<?> aClass = Class.forName("reflection.Cat");
        Object obj = aClass.newInstance();
        Method hi = aClass.getMethod("hi");
        //关闭访问检查 效果比较低
        hi.setAccessible(true);

    }
}
